package app_res

import (
	"hft/Http/Services/front/app/app_dao"
	"hft/Http/Services/front/app/app_model"
	"hft/global"
)

// 获取底部
func (*Application) GetBottom(city int) (data *app_model.Bottom, err error) {
	regionLink, err := app_dao.AppBaseDao.GetRegion(global.OC_DB, city)
	if err != nil {
		return nil, err
	}
	hot := app_dao.AppBaseDao.GetTestLou(global.OC_DB, "热门楼盘", regionLink)
	gangXu := app_dao.AppBaseDao.GetTestLou(global.OC_DB, "刚需好房", regionLink)
	regions := app_dao.AppBaseDao.GetCityRegion(global.OC_DB, city)
	recommend := app_dao.AppBaseDao.GetTestLou(global.OC_DB, "", regionLink)
	bottom := &app_model.Bottom{HotLou: hot, GangXuLou: gangXu, Regions: regions, RecommendLou: recommend}

	return bottom, nil
}
